package com.revzone.demo001.entity.LogEntity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "接收log日志参数信息")
public class AccessLogsDTO {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("主键id")
    private Integer id;
    @TableField("access_name")
    @ApiModelProperty("访问用户名")
    private String accessName;

    @TableField("class_name")
    @ApiModelProperty("访问类路径")
    private String className;

    @TableField("method_name")
    @ApiModelProperty("访问方法名称")
    private String methodName;

    @TableField("ip")
    @ApiModelProperty("访问用户IP地址")
    private String ip;

    @TableField("url")
    @ApiModelProperty("访问API路径")
    private String url;

    @TableField("method")
    @ApiModelProperty("Http数据请求风格")
    private String method;

    @TableField("result")
    @ApiModelProperty("请求结果")
    private String result;

    @TableField("code")
    @ApiModelProperty("请求状态码")
    private String code;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("access_date")
    @ApiModelProperty("请求时间")
    private Date accessDate;

    @TableField("remarks")
    @ApiModelProperty("备注")
    private String remarks;


    //分页数据

    @ApiModelProperty("页数据条数")
    @TableField(exist = false)//非数据库字段
    public Long pageSize = 10L;

    @ApiModelProperty("当前为第几页")//非数据库字段
    @TableField(exist = false)
    public Long currentPage = 1L;
}
